package com.ruoyi.common.enums;

/**
 * @author zhangye
 * @date 2025/2/25 11:00
 * @description
 */
public enum SubType {

    SHIP(1, "舰船"),
    PLANE(2, "飞机"),
    RADAR(3, "雷达"),
    MISSILE(4, "导弹"),
    FIXED_FACILITY(5, "固定设施"),
    PERSON(6, "人物"),
    EVENT(7, "事件");

    private final int type;
    private final String typeName;

    SubType(int type, String typeName) {
        this.type = type;
        this.typeName = typeName;
    }

    // 根据类型编号获取对应的枚举实例
    public static SubType getByType(int type) {
        for (SubType subType : values()) {
            if (subType.type == type) {
                return subType;
            }
        }
        throw new IllegalArgumentException("专题类型不存在：" + type);
    }

    public String getTypeName() {
        return typeName;
    }
}
